//显示个人信息的表单
var personalMessageForm = Ext.create("Ext.form.Panel", {
    header: false,
    bodyPadding: 10,
    border: false,
    defaults: {
        anchor: '100%',
        border: false,
        margin: '20 0 0 0',
    },
    items: [{
        margin: '0 0 0 0',
        xtype: 'textfield',
        labelWidth: 50,
        allowBlank: false,
        fieldLabel: '用户名',
        maxLength: 11,
        emptyText: '限制字数11',
        itemId: 'userName'
    }, {
        xtype: 'textfield',
        labelWidth: 50,
        allowBlank: false,
        fieldLabel: '昵称',
        maxLength: 6,
        emptyText: '限制字数6',
        itemId: 'realName'
    }, {
        xtype: 'displayfield',
        labelWidth: 50,
        fieldLabel: '角色',
        itemId: 'roles'
    }],
    buttons: [{
        itemId: 'saveButton',
        text: '保存',
        listeners: [{
            click: function () {
                personalMessageUpdate();
            }
        }]
    }]
});

//用户修改密码的表单
var updatePasswordForm = Ext.create("Ext.form.Panel", {
    header: false,
    bodyPadding: 10,
    border: false,
    defaults: {
        anchor: '100%',
        border: false,
        margin: '20 0 0 0',
    },
    items: [{
        margin: '0 0 0 0',
        xtype: 'textfield',
        labelWidth: 120,
        allowBlank: false,
        fieldLabel: '请输入旧密码',
        itemId: 'oldPassword',
        maxLength: 20,
        emptyText: '限制字数20'
    }, {
        xtype: 'textfield',
        labelWidth: 120,
        allowBlank: false,
        fieldLabel: '请输入新密码',
        maxLength: 20,
        emptyText: '限制字数20',
        itemId: 'newPassword1'
    }, {
        xtype: 'textfield',
        labelWidth: 120,
        allowBlank: false,
        fieldLabel: '请再次输入新密码',
        emptyText: '限制字数',
        itemId: 'newPassword2',
        maxLength: 20,
        emptyText: '限制字数20'
    }],
    buttons: [{
        itemId: 'saveButton',
        text: '保存',
        listeners: [{
            click: function () {
                personalPasswordUpdate();
            }
        }]
    }],
});

//用于显示班级详细信息的表单
var personalSpaceClassesDetailForm=Ext.create('Ext.form.Panel',{
    bodyPadding: 10,
    defaults: {
        border:false,
        width:'100%',
        anchor: '100%',
        layout: 'column', // 默认定义组件内部元素为布局为列布局方式
    },
    items: [{
        defaults: {
            border:false,
            layout: 'form',
        },
        items: [{
            columnWidth: 1, // 该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                border:false,
                labelWidth: 50,
                fieldLabel: '名称',
                itemId: 'name'
            }]
        }]
    }, {
        defaults: {
            layout: 'form',
            border:false,
            margin:'20 0 0 0'
        },
        items: [{
            columnWidth: .5, // 该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                border:false,
                labelWidth: 50,
                fieldLabel: '创建人',
                itemId: 'creater'
            }]
        }, {
            columnWidth: .5,
            items: [{
                xtype: 'displayfield',
                border:false,
                labelWidth: 50,
                fieldLabel: '负责人',
                itemId: 'leader'
            }]
        }]
    }, {
        defaults: {
            layout: 'form',
            border:false,
            margin:'20 0 0 0'
        },
        items: [{
            columnWidth: .5, // 该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                border:false,
                fieldLabel: '期数:',
                labelWidth: 70,
                itemId: 'stage'
            }]
        }, {
            columnWidth: .5,
            items: [{
                xtype: 'displayfield',
                border:false,
                fieldLabel: '创建时间:',
                labelWidth: 70,
                itemId: 'createDate',
                renderer : function(value) {
                    return value.replace('T', '  ');
                }
            }]
        }]
    }, {
        fieldLabel: '描述信息',
        margin:'20 0 0 5',
        labelWidth: 70,
        readOnly:true,
        xtype: 'textareafield',
        height:'60%',
        itemId: 'describe',
        cls: 'x-form-valid',
        emptyText: '无'
    }]
});

//显示组详细信息的form表单
var personalSpaceGroupDetailForm=Ext.create('Ext.form.Panel',{
    bodyPadding: 10,
    height:'100%',
    defaults:{
        width:'100%',
        margin:'20 0 0 5',
    },
    items: [{
        xtype: 'displayfield',
        margin:'0 0 0 5',
        labelWidth: 50,
        allowBlank: false,
        fieldLabel: '名称',
        emptyText: '限制字数',
        itemId: 'name'
    },{
        xtype: 'displayfield',
        fieldLabel: '创建时间:',
        labelWidth: 70,
        itemId: 'createDate',
        renderer : function(value) {
            return value.replace('T', '  ');
        }
    },{
        fieldLabel: '描述信息',
        allowBlank: false,
        labelWidth: 70,
        xtype: 'textareafield',
        height:'70%',
        itemId: 'describe',
        cls: 'x-form-valid',
        emptyText: '填写描述信息'
    }]
});

//显示项目详细信息的form表单
var personalSpaceProjectDetailForm=Ext.create('Ext.form.Panel',{
    bodyPadding : 10,
    border : false,
    defaults:{
        width:'100%',
        margin:'20 0 0 5'
    },
    items : [ {
        margin:'0 0 0 5',
        xtype: 'displayfield',
        labelWidth : 70,
        fieldLabel : '项目名称',
        itemId : 'name'
    },{
        xtype: 'displayfield',
        fieldLabel: '测试系统:',
        labelWidth: 70,
        itemId: 'system',
        renderer : function(value) {
            return value == "" || null ? '不详' : value;
        }
    },{
        xtype : 'displayfield',
        fieldLabel : '创建时间:',
        labelWidth : 70,
        itemId : 'createDate',
        renderer: function (v, record) {
            return v.replace('T', ' ');
        }
    },{
        xtype : 'displayfield',
        fieldLabel : '负责人:',
        labelWidth : 70,
        itemId : 'leadingCadre'
    },{
        fieldLabel : '描述信息',
        allowBlank : false,
        labelWidth : 70,
        xtype : 'textareafield',
        height : '60%',
        itemId : 'describe',
        cls : 'x-form-valid',
        emptyText : '填写描述信息'
    }]
});